#ifndef __UART_H
#define	__UART_H

#include <stm32f10x.h>
#include <stdio.h>
#include "config.h"

extern  uint8_t volatile Vs100xVolume;


void USART1_Configuration(uint32_t bound,uint8_t pre_prty,uint8_t sub_prty);
int fputc(int ch, FILE *f);
void UART_Send(const uint8_t *Buffer, uint32_t Length);

void USART1_IRQHandler(void);



void USART2_Configuration(uint32_t bound,uint8_t pre_prty,uint8_t sub_prty);
void USART2_IRQHandler(void);

void USART2_printf(USART_TypeDef* USARTx, uint8_t *Data,...);

	 
#if 0//def using_printf
	#include "stdio.h"
	#ifdef __GNUC__
		/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
		set to 'Yes') calls __io_putchar() */
		#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
	#else
		#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
		PUTCHAR_PROTOTYPE;
		#define printf	printf
	#endif /* __GNUC__ */
//#else//#ifdef using_printf
	extern void printf(const char * _Format, ...);
#endif//using_printf


void Time3Init(void);
void timer3_init(uint16_t arr,uint16_t psc,uint8_t pre_prty,uint8_t sub_prty);


uint8_t  KEY_Scan(void);

typedef enum
{ 
	KEY0_NEXT_ONE = 1,
	KEY0_UP_ONE = 2,
	KEY0_PLAY_STOP = 3,
	KEY0_MIAN_REBOOT = 4
}KEY_TypeDef;



#endif /* __UART_H */
